|
|
|
|
|
|
|
Example Filename: String.frm |
|
|
|
|
|
|
|
|
For each of the functions listed in this section, you can click the corresponding button on the form to see the results. |
|
|
|
|
|
|
|
|
Format$() returns a string in a specified format. You can pass date, time, number, or string data to this function, along with instructions on how to format the string. This function replaces the Print Using statement in older BASIC languages. Heres an example: |
|
|
|
 |
|
|
|
|
Private Sub cmdFormat_Click ()
Me.Cls
Me.Print Format$(Now, "General Date")
Me.Print Format$(Now, "Short Date")
Me.Print
Me.Print Format$(50, "Currency")
Me.Print Format$(1250, "Currency")
Me.Print
Me.Print Format$(0, "Yes/No")
Me.Print Format$(1, "Yes/No")
Me.Print Format$(0, "True/False")
Me.Print Format$(1, "True/False")
Me.Print Format$(0, "On/Off")
Me.Print Format$(1, "On/Off")
End Sub |
|
|
|
|
|
|
|
|
String$() returns a string made up of a specific number of characters. Heres an example: |
|
|
|
 |
|
|
|
|
Private Sub cmdString_Click ()
Me.Cls
Me.Print String$(20, "*")
Me.Print String$(5, "#")
Me.Print String$(30, "-")
End Sub |
|
|
|
|
|